<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 在前面追击按一个span */
        .a:before {
            content: "1";
            color: red;
        }

        /* 在前面追击按一个span */
        .a:after {
            content: "2";
            color: blue;
        }
    </style>
</head>

<body>

    <div class="a">呵呵</div>

</body>

</html>